package com.foxzzz.datamemory.repository;


import com.foxzzz.datamemory.entity.BlobSave;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.io.InputStream;
import java.sql.Blob;
import java.util.Date;

public interface BlobSaveRepository extends JpaRepository<BlobSave, String> {
//    @Query("select blob from blob_save where blob_save_id= :id")
//    Blob getDataById(@Param("id") String id);

    @Query(value = "insert into blob_save values(:id,:filename,:dateCreate,:blob)", nativeQuery = true)
    void saveB(@Param("id") String id, @Param("filename") String filename, @Param("date") Date date, @Param("blob") InputStream blob);


}
